package city.spring.modules.oldman.service;

import city.spring.modules.oldman.entity.OldmanLeaveApplyEntity;
import city.spring.modules.oldman.vo.OldmanLeaveApplyEntityVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import lombok.NonNull;
import org.apache.ibatis.annotations.Param;

import java.security.Principal;
import java.util.List;

/**
 * Service：退住申请
 *
 * @author pxm
 * @date 2020-09-30 09:51:23
 */
public interface OldmanLeaveApplyService extends IService<OldmanLeaveApplyEntity> {
    String CACHE_NAME = "oldman_leave_apply";

    /**
     * 业务处理：保存一个 <strong>退住申请</strong>
     *
     * @param entity 退住申请
     */
    void saveOldmanLeaveApply(OldmanLeaveApplyEntity entity, @NonNull Principal user);

    /**
     * 业务处理：修改一个 <strong>退住申请</strong>
     *
     * @param entity 退住申请
     */
    void updateOldmanLeaveApply(OldmanLeaveApplyEntity entity);

    /**
     * 业务处理：删除一个 <strong>退住申请</strong>
     *
     * @param primaryKey 主键ID
     */
    void deleteOldmanLeaveApply(String primaryKey);

    /**
     * 业务处理：删除多个 <strong>退住申请</strong>
     *
     * @param primaryKeys 主键ID列表
     */
    void deleteOldmanLeaveApply(List<String> primaryKeys);

    /**
     * 获取退住申请记录
     *
     * @param page
     * @param wrapper
     * @return
     */
    IPage<OldmanLeaveApplyEntityVO> listPage(Page<? extends OldmanLeaveApplyEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends OldmanLeaveApplyEntity> wrapper);

}